import request from '@/utils/request'

export const getList = ()=>request('/home/category/head')
//轮播图数据
export const getBannerList = (num=1)=>request({
    url:'/home/banner',
    params:{
        distributionSite:num
    }
})
//新鲜好物
export const getNewGoods = ()=>request('/home/new')
//人气推荐
export const getHotGoods = ()=>request('/home/hot')
//商品列表
export const getGoodsList = ()=>request('/home/goods')
//二级分类模块
export const getSecondCategory = (id)=>request({
    url:'/category',
    params:{
        id
    }
})
//二级分类列表
export const getSecondCategoryList = (id)=>request({
    url:'/category/sub/filter',
    params:{
        id
    }
})
/**
 * @description: 获取导航数据
 * @data { 
     categoryId: 1005000 ,
     page: 1,
     pageSize: 20,
     sortField: 'publishTime' | 'orderNum' | 'evaluateNum'
   } 
 * @return {*}
 */
export const getNavList = (data)=>request({
    url:'/category/goods/temporary',
    method:'post',
    data
})